﻿#include "network_interface.hpp"
#include <iostream>

int main()
{
    auto interfaces = NetworkInterface::getAllInterfaces();
    for (const auto& iface : interfaces)
    {
        std::cout << "Interface: " << iface.name << std::endl;
        std::cout << "  Description: " << iface.description << std::endl;
        std::cout << "  MAC: " << iface.macAddress << std::endl;
        std::cout << "  MTU: " << iface.mtu << std::endl;
        std::cout << "  Status: " << (iface.isUp ? "UP" : "DOWN") << std::endl;

        for (const auto& pair : iface.Addresses)
            std::cout << "  IP: " << pair.first << " Subnet: " << pair.second << std::endl;

        std::cout << std::endl;
    }

    if (NetworkInterface::setInterfaceConfig(u8"eth0",
        "192.168.1.100", "255.255.255.0"))
    {
        std::cout << "set success." << std::endl;
    }
    else
    {
        std::cout << "set failed." << std::endl;
    }

    return 0;
}
